package FeiBo;

import java.util.LinkedList;

public class FeiBo {
	private static LinkedList<Integer> list;
	
	static
	{
		list=new LinkedList<>();
	}
	
	public static void saveToList(int n){
		list.removeAll(list);
		for (int i=0;i<n+1;++i){
			list.add(f(i));
		}
		
		System.out.println(list);
	}
	
	private static int f(int n){
		if (n==0){
			return 0;
		}
		
		if (n==1){
			return 1;
		}
		
		return f(n-1)+f(n-2);
	}
}
